package org.summerframework.core.util;

import org.springframework.core.type.AnnotationMetadata;

import java.util.Map;

public class AnnotationMetadataUtil {

	public static Map<String,Object>  getAnnotationAttributeMap(AnnotationMetadata amd, String annotationClassName ) {
		return  amd.getAnnotationAttributes(annotationClassName);
	}

	@SuppressWarnings("unchecked")
	public static <T> T getAnnotationAttribute(AnnotationMetadata amd,String annotationClassName ,String attName) {
		Map<String,Object> attMap = getAnnotationAttributeMap(amd,annotationClassName);
		return (T)attMap.get(attName);
	}


}
